home *** CD-ROM | disk | FTP | other *** search
/ PD ROM 1 / PD ROM Volume I - Macintosh Software from BMUG (1988).iso / Stacks / Hyper Utilities / XCMD's⁄XFCN's / Set⁄GetVolume / GetVolume⁄SetVolume / GetVolume_SetVolume / card_3376.txt < prev    next >
Encoding:
Text File  |  1988-02-27  |  3.1 KB  |  108 lines

  1. -- card: 3376 from stack: in
  2. -- bmap block id: 3804
  3. -- flags: 0000
  4. -- background id: 2810
  5. -- name: P Card
  6.  
  7.  
  8. -- part 1 (button)
  9. -- low flags: 00
  10. -- high flags: A003
  11. -- rect: left=144 top=304 right=326 bottom=371
  12. -- title width / last selected line: 0
  13. -- icon id / first selected line: 0 / 0
  14. -- text alignment: 1
  15. -- font id: 0
  16. -- text size: 12
  17. -- style flags: 0
  18. -- line height: 16
  19. -- part name: Install GetPVolume & SetPVolume
  20. ----- HyperTalk script -----
  21. on mouseUp
  22.   put FileName( "STAK" ) into theTarget
  23.   if theTarget is empty then
  24.     beep 1
  25.     answer "Installation cancelled." with "Ok"
  26.   else
  27.     set cursor to 4 -- the watch
  28.     get second word of the long name of stack
  29.     put it into theSource
  30.     ResCopy value of theSource, theTarget, "XFCN", "GetPVolume"
  31.     if "OK" is in the result then
  32.       ResCopy value of theSource, theTarget, "XCMD", "SetPVolume"
  33.       if "OK" is in the result then answer "Installation complete." with "Ok"
  34.       else error "SetVolume"
  35.     else error "GetVolume"
  36.   end if
  37. end mouseUp
  38.  
  39. on error what
  40.   beep
  41.   answer "Unable to install " & what & "."  with "Cancel"
  42. end error
  43.  
  44.  
  45.  
  46. -- part 2 (field)
  47. -- low flags: 01
  48. -- high flags: 0001
  49. -- rect: left=3 top=67 right=291 bottom=509
  50. -- title width / last selected line: 0
  51. -- icon id / first selected line: 0 / 0
  52. -- text alignment: 0
  53. -- font id: 3
  54. -- text size: 10
  55. -- style flags: 0
  56. -- line height: 13
  57. -- part name: 
  58.  
  59.  
  60. -- part 3 (field)
  61. -- low flags: 01
  62. -- high flags: 0004
  63. -- rect: left=116 top=32 right=57 bottom=407
  64. -- title width / last selected line: 0
  65. -- icon id / first selected line: 0 / 0
  66. -- text alignment: 1
  67. -- font id: 6
  68. -- text size: 18
  69. -- style flags: 17408
  70. -- line height: 24
  71. -- part name: 
  72.  
  73.  
  74. -- part 5 (button)
  75. -- low flags: 00
  76. -- high flags: 0000
  77. -- rect: left=476 top=310 right=333 bottom=506
  78. -- title width / last selected line: 0
  79. -- icon id / first selected line: 1014 / 1014
  80. -- text alignment: 1
  81. -- font id: 0
  82. -- text size: 12
  83. -- style flags: 0
  84. -- line height: 16
  85. -- part name: 
  86. ----- HyperTalk script -----
  87. on mouseUp
  88.   go to card id 2857
  89. end mouseUp
  90.  
  91.  
  92.  
  93.  
  94. -- part contents for card part 2
  95. ----- text -----
  96. GetPVolume and SetPVolume are an XFCN and XCMD that allow you to find out and set the volume of the speaker, as stored in the Parameter RAM, within a script.  The Parameter RAM is where teh Control Panel gets and sets the speaker volume.  There are times when the GetVolume and SetVolume on the previous card are not enough, such as when using the Talk XCMD.  By using these routines, you can work with the volume in cases where the others don't work.  It is not, however, appropriate to modify the Parameter RAM without thought.  Make sure you must use SetPVolume and GetPVolume before you start using them.
  97.  
  98. The format of the commands are:
  99.      SetVolume(<volume>)
  100. and
  101.      GetVolume()
  102. Where <volume> is between 0 and 7.  The parenthesis are required for GetVolume to be recognized as a XFCN by HyperCard.
  103.  
  104. These routines where written by Steven Kienle [72330,111] in TML Pascal, source code is included in the StuffIt file with this Stack.
  105.  
  106. -- part contents for card part 3
  107. ----- text -----
  108. GetPVolume & SetPVolume